package il.ac.tau.arielgue.outxing.agents;

import il.ac.tau.arielgue.outxing.utils.Params;
import proevolution.agents.Organism;
import repast.simphony.annotate.AgentAnnot;
import simphony.util.messages.MessageCenter;

@AgentAnnot(displayName = "UniformOrganism")
public class UniformOrganism extends OutXingOrganism {

	private static final long serialVersionUID = 2405321923093230401L;
	protected static final MessageCenter logger = MessageCenter
			.getMessageCenter(UniformOrganism.class);

	public UniformOrganism() {
		super();
	}

	public UniformOrganism(OutXingOrganism organism) {
		super(organism);
	}

	public UniformOrganism(FAOOrganism organism) {
		super(organism);
	}

	@Override
	public double getOutXingTendency(double slope, double maxX, double midX,
			double offset) {
		double tendency = -1;

		if ((getOutXingModifier() == HOMOZYGOT_AA))
			tendency = Params.getMeanOutXingFraction();
		return tendency;
	}

	@Override
	protected Organism spawn() {
		return new UniformOrganism(this);
	}

	public static OutXingOrganism create(OutXingOrganism parent) {
		return new UniformOrganism(parent);
	}

}
